#ifndef FLAG_H
#define FLAG_H

#include "typedefs.h"
#include "pindef.h"


struct Structure_flag {

          uInt8 bKeyboard:1;
          uInt8 bKeyboardWaitForRelease:1;
          uInt8 bKeyboardDisable:1;
          uInt8 bADC_Complete:1;
          uInt8 bADC_CurrentMeasurementMode:1;
          uInt8 bDummy1:1;
          uInt8 bDummy2:1;
          uInt8 bDrawVoltage:1;

          uInt8 bBatt1_Present:1;
          uInt8 bBatt1_Start:1;
          uInt8 bBatt1_Low:1;
          uInt8 bBatt1_Fast:1;
          uInt8 bBatt1_Topoff:1;
          uInt8 bBatt1_Trickle:1;
          uInt8 bBatt1_Stop:1;
          uInt8 bDummy4:1;

          uInt8 bBatt2_Present:1;
          uInt8 bBatt2_Start:1;
          uInt8 bBatt2_Low:1;
          uInt8 bBatt2_Fast:1;
          uInt8 bBatt2_Topoff:1;
          uInt8 bBatt2_Trickle:1;
          uInt8 bBatt2_Stop:1;
          uInt8 bDummy5:1;

};


enum {
FLAG_KEYBOARD=0,
FLAG_KEYBOARD_WAIT_FOR_RELEASE,
FLAG_KEYBOARD_DISABLE,
FLAG_ADC_CONVERSION_COMPLETE,
FLAG_ADC_CURRENT_MESUREMENT_MODE,

FLAG_BATT1_PRESENT,
FLAG_BATT1_START,
FLAG_BATT1_LOW,
FLAG_BATT1_FAST,
FLAG_BATT1_TOPOFF,
FLAG_BATT1_TRICKLE,
FLAG_BATT1_STOP,

FLAG_BATT2_PRESENT,
FLAG_BATT2_START,
FLAG_BATT2_LOW,
FLAG_BATT2_FAST,
FLAG_BATT2_TOPOFF,
FLAG_BATT2_TRICKLE,
FLAG_BATT2_STOP,

FLAG_DUMMY1,
FLAG_DUMMY2,
FLAG_DRAW_VOLTAGE,
FLAG_DUMMY4,
FLAG_DUMMY5,
FLAG_DUMMY6
};

void SetFlag(uInt8 flag);
void ClearFlag(uInt8 flag);
uInt8 GetFlag(uInt8 flag);
void ResetFlag(void);
#endif
